#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_Type
#include <Type.h>
#endif
#ifndef INCLUDED_jax_lang_JThrowable
#include <jax/lang/JThrowable.h>
#endif
namespace jax{
namespace lang{

Void JThrowable_obj::__construct(::String msg,::jax::lang::JThrowable cause)
{
{
	HX_SOURCE_POS("Source/jax/lang/JThrowable.hx",11)
	this->message = msg;
	HX_SOURCE_POS("Source/jax/lang/JThrowable.hx",12)
	this->cause = cause;
}
;
	return null();
}

JThrowable_obj::~JThrowable_obj() { }

Dynamic JThrowable_obj::__CreateEmpty() { return  new JThrowable_obj; }
hx::ObjectPtr< JThrowable_obj > JThrowable_obj::__new(::String msg,::jax::lang::JThrowable cause)
{  hx::ObjectPtr< JThrowable_obj > result = new JThrowable_obj();
	result->__construct(msg,cause);
	return result;}

Dynamic JThrowable_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JThrowable_obj > result = new JThrowable_obj();
	result->__construct(inArgs[0],inArgs[1]);
	return result;}

::String JThrowable_obj::toString( ){
	HX_SOURCE_PUSH("JThrowable_obj::toString")
	HX_SOURCE_POS("Source/jax/lang/JThrowable.hx",14)
	return (  (((((((::Type_obj::getClassName(::Type_obj::getClass(hx::ObjectPtr<OBJ_>(this))) + HX_CSTRING(": ")) + this->message) + HX_CSTRING(";")) + ::Std_obj::string(this->cause)) == null()))) ? ::String(HX_CSTRING("")) : ::String((HX_CSTRING(" caused by: ") + this->cause->toString())) );
}


HX_DEFINE_DYNAMIC_FUNC0(JThrowable_obj,toString,return )


JThrowable_obj::JThrowable_obj()
{
}

void JThrowable_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JThrowable);
	HX_MARK_MEMBER_NAME(message,"message");
	HX_MARK_MEMBER_NAME(cause,"cause");
	HX_MARK_END_CLASS();
}

void JThrowable_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(message,"message");
	HX_VISIT_MEMBER_NAME(cause,"cause");
}

Dynamic JThrowable_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 5:
		if (HX_FIELD_EQ(inName,"cause") ) { return cause; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"message") ) { return message; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JThrowable_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 5:
		if (HX_FIELD_EQ(inName,"cause") ) { cause=inValue.Cast< ::jax::lang::JThrowable >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"message") ) { message=inValue.Cast< ::String >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JThrowable_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("message"));
	outFields->push(HX_CSTRING("cause"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("message"),
	HX_CSTRING("cause"),
	HX_CSTRING("toString"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JThrowable_obj::__mClass,"__mClass");
};

Class JThrowable_obj::__mClass;

void JThrowable_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.lang.JThrowable"), hx::TCanCast< JThrowable_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JThrowable_obj::__boot()
{
}

} // end namespace jax
} // end namespace lang
